{% extends "blog/sidebar.html" %}
{% block main %}
{% load my_filter %}
<div id="content">
	<div class="contentTop"></div>
    <ul id="posts">
            
            <!--list-->
			{% for entry in entry_list %}
			<div class="postsTop"></div>
            <li>
                <div class="postHeader">
                    <h3>{{ entry.pub_date|date:" Y-m-d H:m:s" }}</h3>
                    <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
                </div>
                <div class="clear"></div>
                <div class="postBody"><!-- |truncatewords:"30" -->
				{% if search_keywords %}
					{{ entry.body|escape|linebreaks|show_keyword:search_keywords }}
				{% else %}
                    {{ entry.body|escape|linebreaks }}
					<p></p>
					
					<!-- {{ entry.body }}<a href="{{ entry.get_absolute_url }}">Details&nbsp;&nbsp;&gt;&gt;</a>
					<p></p> -->
				{% endif %}
                </div>
                <div class="clear"></div>
                <div class="postFooter">
                    <div class="tags">
                            Tag:&nbsp;&nbsp;
							{% for onetag in entry.tags.all %}
								<a href="/tag/{{ onetag }}/">{{ onetag }}</a>&nbsp;&nbsp;
							{% endfor %}
                    </div>
                    <div class="menubar">
						<span class="author">^o^</span>
						|
						<a class="readmore" href="{{ entry.get_absolute_url }}">Read All</a>
						|
						<a class="cmt" href="{{ entry.get_absolute_url|get_url_not_endwithslash }}#cmt_form">Comment(<span class="count">{{ entry.comment_set.count }}</span>)</a>
						|
						<a class="edit" href="edit/{{ entry.id }}">Edit</a>
                    </div>
                </div>
            </li>
			
            <!--/list-->
			<div class="postsBottom"></div>
			{% endfor %}
    </ul>
	{% if is_paginated %}
    <div class="pageNavi">
		{% ifequal current_page 1 %}|&lt; 
		{% else %} <a href="?page=1">|&lt;</a>
		{% endifequal %}
		{% if has_previous %} <a href="/blog?page={{ previous_page }}">&lt;&lt;</a>
		{% else %} &lt;&lt;
		{% endif %}
		{% for p in page_numbers %}
			{% ifequal p current_page %}{{ p }}
			{% else %}<a href="/blog?page={{ p }}">{{ p }}</a>
			{% endifequal %}
		{% endfor %}
		{% if has_next %}<a href="/blog?page={{ next_page }}">&gt;&gt;</a>
		{% else %}&gt;&gt;
		{% endif %}
		{% ifequal current_page pages %}&gt;|
		{% else %} <a href="/blog?page={{ pages }}">&gt;|</a>
		{% endifequal %}
		&nbsp;&nbsp;
		当前页:{{ current_page }}/{{ pages }}
    </div>
	{% endif %}
    <div class="contentBottom"></div> 
</div>
{% endblock %}
